package com.xmtlxx.wms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.Cabinet;
import com.xmtlxx.wms.domain.bo.CabinetBo;
import com.xmtlxx.wms.domain.vo.CabinetVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 柜号Mapper接口
 *
 * @author xmtlxx
 * @date 2022-12-15
 */
public interface CabinetMapper extends BaseMapperPlus<CabinetMapper, Cabinet, CabinetVo> {
    /**
     * 根据条件分页查询柜号
     *
     * @param cabinet 柜号
     * @return Page Cabinet
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    Page<CabinetVo> selectPageCabinetList(@Param("page") Page<Cabinet> page,@Param("cabinet") CabinetBo cabinet);

    /**
     * 查询柜号列表
     *
     * @param cabinet 柜号
     * @return 柜号集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    List<CabinetVo> selectCabinetList(@Param("cabinet") CabinetBo cabinet);

    CabinetVo selectCabinetVoByID(String id);
}
